package com.sykj.chengqiang.controller;


import com.sykj.bean.bis.BisNurseType;
import com.sykj.bean.bis.BisShopPost;
import com.sykj.bean.bis.BisSmsRecord;
import com.sykj.chengqiang.bean.SmsRecord;

import com.sykj.chengqiang.service.BisSmsRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;


@CrossOrigin
@RestController
@RequestMapping(value = "bisSmsRecord")
public class BisSmsRecordController {
    @Autowired
    private BisSmsRecordService bisSmsRecordService;



    /***
     *
     * 综合查询和列表显示
     *
     */

    @RequestMapping( value = "qeuyrRecords")
    public List<BisSmsRecord> qeuyrRecords(BisSmsRecord bisSmsRecord){


        List<BisSmsRecord> list = bisSmsRecordService.queyrRecords(bisSmsRecord);


        return list;
    }



    /**
     * 添加
     * @param
     * @return
     */
    @RequestMapping("/save")
    public Object saveUser(BisSmsRecord bisSmsRecord){
        System.out.println("添加");
       return bisSmsRecordService.save(bisSmsRecord);
    }

    /**
     * 删除
     */
    @RequestMapping("/deleteRecord")
    public Object deleteUser(Integer recordId){
        return bisSmsRecordService.removeById(recordId);

    }


    /**
     * 根据id查询一行数据
     *
     */
    @RequestMapping("/recordGetByid")
    public BisSmsRecord queyrByid(Integer recordId){
        BisSmsRecord record = bisSmsRecordService.getById(recordId);
        return record;
    }


    /**
     * 修改
     */
    @RequestMapping("/updateRecord")
    public Object updateUser(BisSmsRecord bisSmsRecord){
        boolean update = bisSmsRecordService.updateById(bisSmsRecord);
        return update;

    }


}
